
		<div class="conter">
			<div class="login-back">
				<img src="__PUBLIC__/Home/Images/login-bigback.png" />
			</div>
			<div class="middle">
				<a class="back"><img src="__PUBLIC__/Home/Images/login-mid-back.png" /></a>

				<form class="mid-con" id="rgt" method="post">
					<div class="box">
						<label>用户名：</label>
						<input type="text" name="username" id="username" placeholder="用户名/邮箱/手机号/会员卡号" />
						<p id="name">亲，格式不对哦！</p>
						<p id="cxname">亲，该会员名称已被注册！</p>
					</div>
					<div class="box">
						<label>设置密码：</label>
						<input type="password" id="password" name='password' placeholder="请输入密码" />
						<p id="mima">亲，请输入6~16位密码！</p>
						<p id="mimagou">√</p>
					</div>
					<div class="box">
						<label>确认密码：</label>
						<input type="password" id="qrpassword" name='qrpassword' placeholder="请输入密码" />
						<p id="mimaer">亲，密码不一致哦！</p>
						<p id="qrmima">亲，请确认密码！</p>
						<p id="mimaergou">√</p>
					</div>
					<div class="box">
						<label>手机号：</label>
						<input type="text" id="phone" name='phone' placeholder="请输入手机号" />
						<p id="sj">亲，手机号不能为空哦！</p>
						<p id="zqsj">亲，请输入正确号码！</p>
					</div>
					<div class="verification">
						<label>验证码：</label>
						<input type="text" id="verification" name='verification' placeholder="请输入验证码" />
						<img id="verify" src="{:U('Home/Login/Verify')}" onclick="this.src=this.src" width="130" height="50" align="center" style="padding:0 0 5px 20px;cursor: pointer;">
						<button>获取验证码</button>

						<b id="yzmcuo">验证码错误</b>
					</div>
					<div class="box" style="margin-left: 25px;">
						<label>E-mail：</label>
						<input type="text" id="E-mail" name='email' placeholder="请输入注册邮箱" />
						<p id="post">亲，请正确填写邮箱！</p>
					</div>
					<div class="treaty">

						<label>
						
							<input id="treaty" type="checkbox" />
							我已阅读并接受《贺曼在线服务协议》
							</label>
					</div>

					<div class="box">

						<button id="register">立即注册</button>
						
					</div>
				</form>

			</div>
		</div>

		<script type="text/javascript">
		 
		 	



			$("#register").click(function(){
					var treaty = $("#treaty").val();
					if(treaty){
						var formdata = $("#rgt").serialize();
						$.ajax({
							url: '',
							type:'post',
							dataType:'json',
							data:formdata,
							success:function(data){
								if(data.code == 0){
									alert(data.info);
									$("#verify").click();
									return false;
								}else{
									alert(data.info);
									window.location.href="{:U('login')}";
									return false;
								}
								
							},
							error:function(data){

							}

						})
						return false;
					}else{
						return false;
					}
					
				})




				// $(".verification button").click(function(){
				// 	var str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
				// 	var n = 4, s = "";
				// 	for(var i = 0; i < n; i++){
				// 	    var rand = Math.floor(Math.random() * str.length);
				// 	    s += str.charAt(rand);
				// 	}
				// 	$(".verification button").text(s);
				// })
				
				
				
			
		</script>
	</body>
</html>
